/*
 * fcl_foc.h
 *
 *  Created on: 2024年11月5日
 *      Author: zizhong
 */

#ifndef USER_SRC_FCL_FOC_H_
#define USER_SRC_FCL_FOC_H_


typedef struct _FCL_Parameters_t_
{
    float   carrierMid;     // Mid point value of carrier count
    float   adcPPBScale;    // ADC conversion scale to pu
    float   cmidsqrt3;      // internal variable

    float   tSamp;          // sampling time
    float   Rd;             // Motor resistance in D axis
    float   Rq;             // Motor resistance in Q axis
    float   Ld;             // Motor inductance in D axis
    float   Lq;             // Motor inductance in Q axis
    float   Vbase;          // Base voltage for the controller
    float   Ibase;          // Base current for the controller
    float   invZbase;       // Inverter Base voltage for the controller
    float   wccD;           // D axis current controller bandwidth
    float   wccQ;           // Q axis current controller bandwidth
    float   Vdcbus;         // DC bus voltage
    float   BemfK;          // Motor Bemf constant
    float   Wbase;          // Controller base frequency (Motor) in rad/sec
} FCL_Parameters_t;

#define FCL_PARS_DEFAULTS {                                                    \
    0, /* carrierMid */                                                        \
    0, /* adcPPBScale */                                                       \
    0, /* cmidsqrt3 */                                                         \
    0, /* tSamp */                                                             \
    0, /* Rd */                                                                \
    0, /* Rq */                                                                \
    0, /* Ld */                                                                \
    0, /* Lq */                                                                \
    0, /* Vbase */                                                             \
    0, /* Ibase */                                                             \
    0, /* wccD */                                                              \
    0, /* wccQ */                                                              \
    0, /* Vdcbus */                                                            \
    0, /* BemfK */                                                             \
    0  /* Wbase */                                                             \
}


#endif /* USER_SRC_FCL_FOC_H_ */
